﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DMS.Business.Modules.ArchivesManagement;
using DMS.Business.Utility;
using DMS.Data;
using DMS.Data.Modules.ArchivesManagement;

namespace DMS.Web.Modules.ArchivesManagement
{
    public partial class PrintLabels : System.Web.UI.Page
    {
        public string fromType = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (PreviousPage != null)
                {
                    string condition = "";
                    int total;
                    if (PreviousPage is BaseInfoList)
                    {
                        
                        var prevPage = PreviousPage as BaseInfoList;
                        condition = prevPage.CondtionString.Split(';')[0];
                        fromType = prevPage.CondtionString.Split(';')[1]=="个人基本信息"?"GR":"DW/GTH";
                        List<AM_BaseInfo> list = BaseInfoService.GetBaseInfos(SystemContext.Current.LoginUser,
                                                                              condition,
                                                                              0, -1, out total);
                        Repeater1.DataSource = list;
                    }
                    else if (PreviousPage is ZHArchInfoList)
                    {
                        fromType = "ZHInfo";
                        var prevPage = PreviousPage as ZHArchInfoList;
                        condition = prevPage.CondtionString;
                        List<ZHArchInfo> list = ZHArchInfoService.GetZHArchInfos(SystemContext.Current.LoginUser, "",
                                                                                 condition,
                                                                                 0, -1, out total);
                        Repeater1.DataSource = list;
                    }

                }
                Repeater1.DataBind();
            }

        }
    }
}